<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>就诊记录详情</title>
    <%- include('../_global/baseLibsJKDA') %>
        <link rel="stylesheet" href="/static/css/jkda/page-main.css" />
        <link rel="stylesheet" href="/static/css/public.css">
        <script src="/static/js/<%=type%>/pageUrl.js"></script>
        <script src="/static/js/<%=type%>/jkda.js"></script>
        <style type="text/css">
            html,
            body {
                width: 100%;
                height: 100%;
                margin: 0px;
                background: #fff;
            }

            table {
                margin: 1rem 0;
            }

            tr th,
            td {
                text-align: center;

            }

            tr td {
                border-bottom: 1px solid #eee;
            }

            .bg_white {
                background: #fff;
            }
        </style>

</head>

<body class="bg_white">
    <header class="header-box grey fixed">
        <div class="header-content">
            <div class="left-tool">
                <a class="back" href="javascript:void(0);">
                    <i class="iconfont icon-back"></i>
                </a>
            </div>
            <div class="title">门诊记录详情</div>
        </div>
    </header>
    <section class="page-clinic-details bg_white">
        <ul class="detail mzDetail">
            <li class="t-box">
                <i class="detail-icon j-1"></i>
                <h3>门诊信息</h3>
                <div id="Mzxx">

                </div>
            </li>
            <li>医院:
                <span name="hosName"></span>
            </li>
            <li>就诊时间:
                <span name="orderDate"></span>
            </li>
            <li>就诊科室:
                <span name="depName"></span>
            </li>
        </ul>

        <ul class="detail">
            <li class="t-box">
                <i class="detail-icon j-1"></i>
                <h3>药品信息</h3>
                <div>

                </div>
            </li>
            <div id="mzMedicine">

            </div>
        </ul>
        <!-- <aside class="health-file-tool">
    <ul class="health-file-list clearfix">
        <div id="menu1" class="runDiv" style="position:relative" module="jcbg">
            <div>
                <img class="icon-list" src="/static/images/jkda/icon1.png">
                <h2 class="span-text">检查报告</h2>
            </div>
        </div>
        <div id="menu4" class="runDiv" style="position:relative"  module="jybg">
            <div>
                <img class="icon-list" src="/static/images/jkda/icon2.png">
                <h2 class="span-text">检验报告</h2>
            </div>
        </div>
        <div id="menu5" class="runDiv" style="position:relative" module="dzcf">
            <div>
                <img class="icon-list" src="/static/images/jkda/icon3.png">
                <h2 class="span-text">电子处方</h2>
            </div>
        </div>
    </ul>
</aside> -->
    </section>
</body>
<script type="text/javascript">
    var page_jzDetail = (function ($, page_jzDetail) {
        var info = StoreCache.getCache("mzInfo");
        var zxwyh = $.QuickUrlUtils.getRequest("ZXWYH");
        var serialNumber = info.serialNum;
        var hosOrgCode = info.hosCode;

        var cfg_def = {
            initData: initData,
            callBack: callBack,

        }

        page_jzDetail.init = function (cfg) {
            $.extend(page_jzDetail, cfg_def, cfg);
            page_jzDetail.initData();

            $.QuickRemote.AjaxJson({
                funcName: "/api/gzd/jkda/queryDetailCfbg",
                callback: page_jzDetail.callBack,
                params: {
                    "zxwyh": zxwyh,
                    "serialNumber": serialNumber, //就诊流水号
                    "hosOrgCode": hosOrgCode,
                    // "zxwyh": "310225196511175223",
                    // "serialNumber": "2016020495624600", //就诊流水号
                    // "hosOrgCode": "42490566300"
                } //医疗机构代码
                ,
                header: true
            });

        }




        function initData() {
            var info = StoreCache.getCache("mzInfo");
            $(".mzDetail").find("span").each(function () {
                $(this).text(info[$(this).attr("name")]);
            });
        };



        function callBack(response) {
            $("#mzMedicine").html(template("Medicine", {
                data: response
            }));
        }

        return page_jzDetail;
    })(jQuery, {});

    // $.pageSwitch.clickToUrl(".health-file-list","jzDetail");
</script>
<script type="text/html" id="Medicine">

    <table>
        <tr>
            <th>发药量</th>
            <th>用法</th>
            <th>药品名称</th>
            <th>用药量</th>
            <th>用药频次</th>
        </tr>
        {{each data}}
        <tr>
            <td width="15%">{{$value.fyl}}</td>
            <td width="15%">{{$value.yf}}</td>
            <td width="30%">{{$value.ypmc}}</td>
            <td width="20%">{{$value.yyl}}</td>
            <td width="20%">{{$value.yypc}}</td>
        </tr>
        {{/each}}
    </table>

</script>

</html>